package com.chenfan.ccp.plug.business.parser;

import com.alibaba.fastjson.JSON;
import org.springframework.core.convert.TypeDescriptor;
import org.springframework.expression.TypeConverter;

/**
 * @author xutong
 */
public class LogTypeConverter implements TypeConverter {
    @Override
    public boolean canConvert(TypeDescriptor typeDescriptor, TypeDescriptor typeDescriptor1) {
        return true;
    }

    @Override
    public Object convertValue(Object o, TypeDescriptor typeDescriptor, TypeDescriptor typeDescriptor1) {
        return JSON.toJSONString(o);
    }

}
